<template>
    <h3>这个是Home组件</h3>
    <p>count: {{ count }}</p>
    <p>doubleCount: {{ appStore.getDoubleCount() }}</p>
    <button @click="changCount">修改 count</button>

    <a-button @click="changCount">Add</a-button>
</template>


<script setup lang="ts">
    import { storeToRefs } from 'pinia'
    import { useAppStore } from '@/store/app'

    const appStore = useAppStore()
    const { count } = storeToRefs(appStore)

    function changCount() {
        appStore.setCount(count.value + 2)
    }
</script>
